import request from '@/config/axios'

// 书籍漂出 VO
export interface LwBookOutApplyVO {
  lwBookIds: string // 书籍id集合
  applyUid: number // 申请人id
  processStatus: number // 流程状态
  initialReviewUid: number // 初审人
  initialReviewDes: string // 初审说明
  remark: string // 备注
}

// 书籍漂出 API
export const LwBookOutApplyApi = {
  // 查询书籍漂出分页
  getLwBookOutApplyPage: async (params: any) => {
    return await request.get({ url: `/bk/lw-book-out-apply/page`, params })
  },

  // 查询书籍漂出详情
  getLwBookOutApply: async (id: number) => {
    return await request.get({ url: `/bk/lw-book-out-apply/get?id=` + id })
  },

  // 新增书籍漂出
  createLwBookOutApply: async (data: LwBookOutApplyVO) => {
    return await request.post({ url: `/bk/lw-book-out-apply/create`, data })
  },

  // 修改书籍漂出
  updateLwBookOutApply: async (data: LwBookOutApplyVO) => {
    return await request.put({ url: `/bk/lw-book-out-apply/update`, data })
  },

  // 删除书籍漂出
  deleteLwBookOutApply: async (id: number) => {
    return await request.delete({ url: `/bk/lw-book-out-apply/delete?id=` + id })
  },

  // 导出书籍漂出 Excel
  exportLwBookOutApply: async (params) => {
    return await request.download({ url: `/bk/lw-book-out-apply/export-excel`, params })
  },
  // 漂出终审
  applyBooks: async (data: any) => {
    return await request.post({ url: `/bk/lw-book-out-apply/applyBooks`, data })
  },
  // 漂出终审
  outApplyExamine: async (data: any) => {
    return await request.post({ url: `/bk/lw-book-out-apply/outApplyExamine`, data })
  },

  // 获取导入模板
  importTemplate: async () => {
    return await request.download({ url: `/bk/lw-book-out-apply/get-import-template` })
  },
}
